/**
 * 常量配置
 */

export const CARD_COLORS = [
  { value: 0, text: '金色', color: 'goldenrod' },
  { value: 1, text: '银色', color: 'silver' },
  { value: 2, text: '黑色', color: 'black' }
]

/* export const getColorByStyle = (style=2) => {
  let color 
  for(let i=0; i<CARD_COLORS.length; i++) {
    if (CARD_COLORS[i].value == style) {
      color = CARD_COLORS[i].color
      break
    }
  }
  return color
} */

export const getColorByStyle = (style=2) => {
  const obj = CARD_COLORS.find(item => item.value == style)
  return obj.color
}